<template>
  <div class="pageListWrap">
    <div class="pageTableInner">
      <div class="totalWrap" style="top: 123px;">
        <el-form class="form" ref="ruleFormAdd" label-width="80px">
	        <el-form-item label="总量">
	          <el-input class="total-input" size="small" :maxlength="200" v-model="total" placeholder="请输入总量"></el-input>
	        </el-form-item>
	        <el-form-item>
	        	<el-button type="primary" @click="updateEvent">提交</el-button>
	        </el-form-item>
	      </el-form>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props: [],
    data(){
      return {
        total: 0
      }
    },
    components: {},
    methods: {
      updateEvent(){
        this.axios.post(process.env.API_HOST + '/area/updateBicyclePark', {bicyclePark: this.total}).then(response => {
          let result = response.data
          if (result.code === 200) {
            this.$message.success('更新成功!')
          }
        })
      },
      loadData(){
        this.axios.post(process.env.API_HOST + '/area/selectBicyclePark', {}).then(response => {
          let result = response.data
          if (result.code === 200) {
            this.total=result.result
          }
        })
      }
    },
    created(){
      this.loadData()
    },
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "../../common/stylus/mixin.styl"
  .totalWrap
    margin 10px
    padding 10px
    border-radius 5px
    background-color #fff
    .total-input
      width 30%
  .form
    padding 20px
</style>